<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景图片</title>
    <style>
        div {
            width: 300px;
            height: 300px;
            background-image: url(img/wzry.jpg);
            background-color: pink;


            /*1.背景图片不平铺*/
            background-repeat: no-repeat;
            /*2.默认的情况下，背景图片是平铺的*/
            /* background-repeat: repeat;*/
            /*3．沿着x轴平铺*/
            /* background-repeat: repeat-x;*/
            /*4．沿着Y轴平铺*/
            /* background-repeat: repeat-y; */
            /*页面元素既可以添加背景颜色也可以添加背景图片只不过背景图片会压住背景颜色*/

        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>